package com.haipumi.back.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class CommonAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7909981283455207568L;

	
	protected int rows=10;
	protected int page=0;
	protected String order="asc";
	protected String sort;
	
	protected int start=(page-1)*rows;
	protected int end=(page-1)*rows+rows;
	
	protected HttpServletRequest request=ServletActionContext.getRequest();
	protected HttpServletResponse response=ServletActionContext.getResponse();
	
	
	public int getStart() {
		return start;
	}
	public int getEnd() {
		return end;
	}
	public int getRows() {
		return rows;
	}
	public void setRows(int rows) {
		this.rows = rows;
		start=(page-1)*rows;
		end=(page-1)*rows+rows;
	}
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
		start=(page-1)*rows;
		end=(page-1)*rows+rows;
	}
	public String getOrder() {
		return order;
	}
	public void setOrder(String order) {
		this.order = order;
	}
	public String getSort() {
		return sort;
	}
	public void setSort(String sort) {
		this.sort = sort;
	}
}
